export function cryptoEmail(email) {
  return email.replace(/(\w{1}).*(\w{1})@(.*)/, "$1***$2@$3");
}

export function cryptoPhone(phone: number) {
  return [...`${phone}`]
    .map((item, index) => {
      if ([3, 4, 5, 6].includes(index)) {
        return "*";
      }

      return item;
    })
    .join("");
}

export function cryptoString(str: string) {
  return [...`${str}`]
    .map((item, index) => {
      if ([2, 3, 4].includes(index)) {
        return "*";
      }

      return item;
    })
    .join("");
}
